package com.ruoyi.product.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.ProductsMapper;
import com.ruoyi.product.domain.Products;
import com.ruoyi.product.service.IProductsService;

/**
 * 产品Service业务层处理
 * 
 * @author liaoyuan2
 * @date 2024-10-17
 */
@Service
public class ProductsServiceImpl implements IProductsService
{
    @Autowired
    private ProductsMapper productsMapper;

    /**
     * 查询产品
     * 
     * @param pId 产品主键
     * @return 产品
     */
    @Override
    public Products selectProductsByPId(Long pId)
    {
        return productsMapper.selectProductsByPId(pId);
    }

    /**
     * 查询产品列表
     * 
     * @param products 产品
     * @return 产品
     */
    @Override
    public List<Products> selectProductsList(Products products)
    {
        return productsMapper.selectProductsList(products);
    }

    /**
     * 新增产品
     * 
     * @param products 产品
     * @return 结果
     */
    @Override
    public int insertProducts(Products products)
    {
        return productsMapper.insertProducts(products);
    }

    /**
     * 修改产品
     * 
     * @param products 产品
     * @return 结果
     */
    @Override
    public int updateProducts(Products products)
    {
        return productsMapper.updateProducts(products);
    }

    /**
     * 批量删除产品
     * 
     * @param pIds 需要删除的产品主键
     * @return 结果
     */
    @Override
    public int deleteProductsByPIds(Long[] pIds)
    {
        return productsMapper.deleteProductsByPIds(pIds);
    }

    /**
     * 删除产品信息
     * 
     * @param pId 产品主键
     * @return 结果
     */
    @Override
    public int deleteProductsByPId(Long pId)
    {
        return productsMapper.deleteProductsByPId(pId);
    }

    @Override
    public String selectProductsCount() {
        return productsMapper.selectProductsCount();
    }
    @Override
    public String selectProductsGoodCount() {
        return productsMapper.selectProductsGoodCount();
    }
}
